package com.android.djlmapp.http;

import com.lzy.okgo.callback.AbsCallback;
import com.lzy.okgo.convert.StringConvert;
import com.lzy.okgo.model.Response;

/**
 * Created by Administrator on {DATE}.
 */
public abstract class MyCallback extends AbsCallback<String> {

    private String mS;

    @Override
    public void onSuccess(Response<String> response) {


    }

    @Override
    public String convertResponse(okhttp3.Response response) throws Throwable {
        mS = new StringConvert().convertResponse(response);

        response.close();
        return mS;
    }

    @Override
    public void onError(Response<String> response) {
        super.onError(response);
        MyOnError(response, mS);
    }

    public abstract void MyOnError(Response<String> response, String errorMsg);
}
